#include "HttpReply.h"
#include <sstream>

using namespace std;
using namespace network;

string HttpReply::toString() const {
    ostringstream stream;
    stream << version_ << ' ' << status_code_ << ' ' << status_ << "\r\n";
    for (const auto &it: header_) {
        stream << it.first << ": " << it.second << "\r\n";
    }
    stream << "\r\n" << body_;
    return stream.str();
}
